$(function () {
    //表单验证
    $('#loginForm').bootstrapValidator({
        fields: {
            account: {
                validators: {
                    notEmpty: {},/*非空提示*/
                    regexp: {
                        regexp: /^[a-zA-Z0-9_\.]+$/,
                    },
                    stringLength: {/*长度提示*/
                        min: 2,
                        max: 30,
                    }
                }
            },
            password: {
                validators: {
                    notEmpty: {},
                    stringLength: {
                        min: 6,
                        max: 30,
                    },
                    different: {//不能和用户名相同
                        field: 'account',
                    },
                    regexp: {
                        regexp: /^[a-zA-Z0-9_\.]+$/,
                    }
                }
            }
        }
    });
});
